package com.woniu;

import com.woniu.service.impl.UserOrdersServiceImpl;
import com.woniu.service.impl.UserServiceImpl;
import com.woniu.tools.WeatherService;
import com.woniu.tools.WriteFileAndContent;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestClient;



@SpringBootApplication
//@EnableScheduling // 启用 Spring 定时任务
public class WoNiuWeChatMiniProgramApplication {

    public static void main(String[] args) {
        SpringApplication.run(WoNiuWeChatMiniProgramApplication.class, args);
    }
    @Bean
    public ToolCallbackProvider weatherTools(WeatherService weatherService) {
        return MethodToolCallbackProvider.builder().toolObjects(weatherService).build();
    }
    @Bean
    public ToolCallbackProvider adduserTools(UserServiceImpl userService) {
        return MethodToolCallbackProvider.builder().toolObjects(userService).build();
    }

    @Bean
   public ToolCallbackProvider findOrderTools(UserOrdersServiceImpl orderService) {
        return MethodToolCallbackProvider.builder().toolObjects(orderService).build();
    }
    @Bean
    public ToolCallbackProvider writeFile(WriteFileAndContent findAllTeacher) {
        return MethodToolCallbackProvider.builder().toolObjects(findAllTeacher).build();
    }

    
    @Bean
    public RestClient.Builder restClientBuilder() {
        return RestClient.builder();
    }
}
